package org.opensource.yabts.client;

import org.springframework.security.acls.domain.BasePermission;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.RootPanel;
import com.smartgwt.client.types.Alignment;

public class MainEntryPoint implements EntryPoint {
//
//	private final AuthServiceAsync authService = GWT.create(AuthService.class);
//
//	private final Messages messages = GWT.create(Messages.class);

	public void onModuleLoad() {
		LoginForm loginForm = new LoginForm();
		
		loginForm.setWidth(280);
		loginForm.setLayoutAlign(Alignment.CENTER);
		RootPanel.get("content").add(loginForm);
	}

//	public void onModuleLoad() {
//		VLayout layout = new VLayout();
//		final DynamicForm form = new DynamicForm();
//		final TextItem textItem = new TextItem("j_username", "Username");
//		final PasswordItem passwordItem = new PasswordItem("j_password", "Password");
//		ButtonItem buttonItem = new ButtonItem("loginButton", "Log in");
//
//		buttonItem.setColSpan(2);
//		buttonItem.setAlign(Alignment.RIGHT);
//		buttonItem.addClickHandler(new ClickHandler() {
//			
//			public void onClick(ClickEvent event) {
//				authService.doLogin(textItem.getEnteredValue(), passwordItem.getEnteredValue(), new AsyncCallback<Void>() {
//					
//					public void onSuccess(Void result) {
//						
//					}
//					
//					public void onFailure(Throwable caught) {
//						System.out.println(caught.getMessage());
//					}
//				});
//				
//			}
//		});
//		
//		form.setWidth(280);
//		form.setLayoutAlign(Alignment.CENTER);
//		form.setAction("/j_spring_security_check");
//		form.submit();
//
//		layout.setWidth100();
//
//		form.setItems(textItem, passwordItem, buttonItem);
//
//		layout.addMember(form);
//
//		RootPanel.get("content").add(layout);
//	}
}
